﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using WeifenLuo.WinFormsUI.Docking;
using ICSharpCode.TextEditor;
using ICSharpCode.TextEditor.Gui.CompletionWindow;
using ICSharpCode.TextEditor.Document;
using ICSharpCode.TextEditor.Actions;

namespace MyToolkit
{
    /**
     *
     * http://msdn.microsoft.com/zh-cn/library/bb126445 T4模板教程
     * */

    public partial class FrmTemplateEdit : DockContent
    {
        public String EditText { get { return this.textEditorControl1.Text; } }

        public FrmTemplateEdit(string content)
        {
            InitializeComponent();

            if (!String.IsNullOrEmpty(content))
            {
                this.textEditorControl1.Text = content;
            }
        }

        private void FrmTemplateEdit_Load(object sender, EventArgs e)
        {
            this.textEditorControl1.Document.HighlightingStrategy = HighlightingStrategyFactory.CreateHighlightingStrategy("C#");
            this.textEditorControl1.Encoding = Encoding.Default;
        }
    }
}
